
<!DOCTYPE html>
<html style="height: 100%">
<head>
<meta charset="utf-8">
<!-- 引入 ECharts 文件 -->
<script type="text/javascript" src="js/echarts.min.js"></script>
<script type="text/javascript" src="layui/layui.js"></script>
<script type="text/javascript" src="js/echarts.min.js"></script>
<script type="text/javascript" src="js/jquery.min.js"></script>

</head>
<body style="height: 80%; margin: 0">
	<!-- 为 ECharts 准备一个具备大小（宽高）的 DOM -->
	<div id="main" style="height: 80%;"></div>
</body>
			<script type="text/javascript">
				var chartDom = document.getElementById('main');
				var myChart = echarts.init(chartDom);
				var option;
				
				$.post("getStatis",{},function(res){
					var shujuValue = new Array();
					var dates=[];
					for(var i=0;i<res.data.length;i++){
							data={value: res.data[i][2], name: res.data[i][1]}
			   	    		dates[i]=data
					
					}
				
				
					option = {
				    title: {
				        text: '基于资源室的统计',
				        left: 'center'
				    },
				    tooltip: {
				        trigger: 'item'
				    },
				    legend: {
				        orient: 'vertical',
				        left: 'left',
				    },
				    series: [{
				            name: '访问来源',
				            type: 'pie',
				            radius: '50%',
				            data: dates,
				            emphasis: {
				                itemStyle: {
				                    shadowBlur: 10,
				                    shadowOffsetX: 0,
				                    shadowColor: 'rgba(0, 0, 0, 0.5)'
				                }
				            }
				        }]	
				
				}
				 // 使用刚指定的配置项和数据显示图表。
        		myChart.setOption(option);
					},"json")
					
    </script>
</html>